        extern _printf
        extern _scanf

        section .data
fmt0:   db "%i", 0
fmt1:   db "Enter number", 0xA, 0
fmt2:   db "Sum od %d and %d is %d", 0xA, 0

        section .text
        global _main
_main:  ;int3
        call add
        xor eax, eax
        ret

add:
    push ebp
    mov ebp, esp
    sub esp, 0x8

    call prompt
    lea eax, [ebp - 0x8]
    call read
    
    call prompt
    lea eax, [ebp - 0x4]
    call read

    xor eax, eax
    mov eax, [ebp - 0x8]
    add eax, [ebp - 0x4]
    
    push eax
    push dword [ebp - 0x8]
    push dword [ebp - 0x4]
    push fmt2
    call _printf
    add esp, 0x10
   
   leave
   ret

prompt:
    push fmt1
    call _printf
    add esp, 0x4
    ret

read:
    push eax
    push fmt0
    call _scanf
    add esp, 0x8
    ret
